<?php

namespace Api\Member\AccessLog;

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration as BaseMigration;

/**
 * 迁移
 */
class Migration extends BaseMigration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        /**
         * 访问日志
         */
        if (! Schema::hasTable('member__access_logs')) {
            Schema::create('member__access_logs', function (Blueprint $table) {
                $table->engine = 'InnoDB';
                $table->increments('id');

                $table->date('date')             ->comment('日期');
                $table->unsignedInteger('total') ->comment('站点被访问的次数');

                $table->timestamps();
                $table->softDeletes();
            });
        }
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('member__access_logs');
    }

}
